﻿<UserControl x:Class="wUniApp.WPF.Controls.ucPatientDetail"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:sparrow="http://sparrowtoolkit.codeplex.com/wpf"
             xmlns:loc="clr-namespace:wUniAppPCL.Loacalization;assembly=wUniAppPCL"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="300">
  <UserControl.Resources>

    <Style TargetType="{x:Type ListViewItem}">
      <Style.Triggers>
        <Trigger Property="ItemsControl.AlternationIndex" Value="0">
          <Setter Property="Background" Value="#7F000000"/>
        </Trigger>
        <Trigger Property="ItemsControl.AlternationIndex" Value="1">
          <Setter Property="Background" Value="Transparent"/>
        </Trigger>
      </Style.Triggers>
    </Style>
  </UserControl.Resources>
  <Grid>
    <Grid.ColumnDefinitions>
      <ColumnDefinition Width="30*" />
      <ColumnDefinition Width="70*" />
    </Grid.ColumnDefinitions>
    <Grid>
      <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="*" />
      </Grid.RowDefinitions>
      <Border Background="#7F000000" Margin="4">
        <StackPanel Margin="8">
          <TextBlock Text="Age:" FontSize="10" />
          <TextBlock Text="{Binding SelectedItem.Age}" FontSize="16" Foreground="White"/>
          <TextBlock Text="Height:" FontSize="10" />
          <TextBlock Text="{Binding SelectedItem.Height}" FontSize="16" Foreground="White"/>
          <TextBlock Text="Weight:" FontSize="10" />
          <TextBlock Text="{Binding SelectedItem.Weight}" FontSize="16" Foreground="White"/>
          <Label  Content="{Binding Count}" Foreground="White" Margin="-6, 0" />
        </StackPanel>
    </Border>
    <ListView ItemsSource="{Binding Items}" Foreground="White"
      Grid.Row="1" Background="Transparent" BorderBrush="Transparent"
      VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
      <ListView.Resources>
        <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="SteelBlue"/>
      </ListView.Resources>
      <ListView.ItemTemplate>
        <DataTemplate>
          <StackPanel>

            <TextBlock Text="Priezvisko / Meno " FontSize="8" />
            <TextBlock Text="{Binding LastName}" FontWeight="Bold" FontSize="20" />
            <TextBlock Text="{Binding FirstName}" FontWeight="Normal" FontSize="16" />

          </StackPanel>
        </DataTemplate>
      </ListView.ItemTemplate>
    </ListView>
  </Grid>
  <sparrow:SparrowChart Grid.Column="1" 
                          Foreground="White" Margin="2"  >
      <sparrow:SparrowChart.XAxis>
        <sparrow:CategoryXAxis Header="Average vs. Selected"   >
        </sparrow:CategoryXAxis>
      </sparrow:SparrowChart.XAxis>
      <sparrow:SparrowChart.YAxis>
        <sparrow:LinearYAxis Header="Values" StringFormat="0.00" />
      </sparrow:SparrowChart.YAxis>
      <sparrow:ColumnSeries PointsSource="{Binding Collection}" 
                    XPath="X" YPath="Y" Fill="#7F003366" BorderBrush="Transparent"/>
      <sparrow:ColumnSeries PointsSource="{Binding Averages.Collection}" 
                    XPath="X" YPath="Y" Fill="SteelBlue"/>
    </sparrow:SparrowChart>
  </Grid>
</UserControl>
